package main

import (
	"github.com/micro/go-micro"
	"log"
	student "microstudent/proto/student"
	"microstudent/proto/teacher"
	"microstudent/server/service"
)

func main() {
	srv := micro.NewService(
		micro.Name("dh.com.microStudent"),
	)
	srv.Init()

	err := student.RegisterStudentServiceHandler(srv.Server(), new(service.StudentServiceHandler))
	if err != nil {
		log.Fatalln(err)
	}
	err = teacher.RegisterTeacherServiceHandler(srv.Server(), new(service.TeacherServiceHandler))
	if err != nil {
		log.Fatalln(err)
	}

	err = srv.Run()
	if err != nil {
		log.Fatalln(err)
	}
}
